package kr.hkit.powerjava.chther09;

public class Car {
	private static int numberofcars;
	
	private String color;
	private int speed;
	private int gear;
	private int id;
	
	public Car(String color, int speed, int gear) {
		this.color = color;
		this.speed = speed;
		this.gear = gear;
		this.id = ++Car.numberofcars;
	}
	public static void main(String[] args) {
		System.out.println("수"+Car.numberofcars);
		System.out.println("수"+Car.getNumberofcars());
		
		Car blue = new Car("blue",100,1);
		System.out.println("수"+Car.numberofcars);
		Car red = new Car("red",60,2);
		System.out.println("수"+Car.numberofcars);
		Car green = new Car("green",8,3);
		
		System.out.println("수"+Car.numberofcars);
		System.out.println("수"+Car.getNumberofcars());
	}
	public static int getNumberofcars() {
		return numberofcars;
	}
}
